<script setup lang="ts">
import ByButton from '@/components/ui/ByButton.vue';

defineProps<{
  btnText?: string;
  congrat?: boolean;
}>();

defineEmits<{
  btnTap: [];
}>()

</script>

<template>
  <view class="mt-20 relative w-[620px] mx-auto">
    <image src="/static/svg/contentbox-bg.svg" class="w-full" mode="widthFix" />
    <image v-if="congrat"
           src="/static/svg/contentbox-bg-sus.svg" class="absolute left-0 top-0 w-full scale-110" mode="widthFix" />

    <view class="absolute top-0 w-full h-full flex-center z-[5]">
      <slot />
    </view>
  </view>

  <view class="mt-7 text-center">

    <slot name="footer" />

    <ByButton v-if="btnText"
              class="mt-3 bg-dark w-[384px]"
              @tap="$emit('btnTap')">
      {{ btnText }}</ByButton>
  </view>
</template>
